
clc;clear;close all;

% load PaviaU;
% img = paviaU/8000;

filename='data/modis/MOD021KM.A2010128.1645.005.2010129013524.hdf';
[image] =loadModis1BData(filename);

img = double( image );
img = double(img/max(max(max(img))));
img = img(1:300, 1:300, :);

addpath(genpath('DLToolbox'));
addpath('BPFA');

rf = 3;

%Train DBN
params.numTrain = 10000; % Traning number
params.numLayerNodes  = [100 100 50]; % layer number
params.numIters = 2; % iteration 
params.momentum = 0; 
params.alpha = 1;
[img,dbn] = fvLearnDBN(img,rf,params);

% Train SAE
% params.numTrain = 10000;
% params.numLayerNodes  = [100 100 50];
% params.numIters = 2;
% params.momentum = 0;
% params.alpha = 1;
%[img,sae] = fvLearnSAE(img,rf,params);

% % Train BPFA
% params.numTrain=1000;
% params.K = 100;
% params.numIters = 2;
% 
% [img,bpfa] = fvLearnBPFA(img,rf,params);




